package com.xiangge.test;

import java.util.Scanner;

public class Demo1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入机票原价：");
        double yuanjia = input.nextDouble();
        System.out.print("请输入月份：");
        int yue = input.nextInt();
        System.out.print("请输入机舱类型：");
        String cangwei = input.next();


        double zhekou = 0.0;
        switch (cangwei){
            case "头等舱":
                if (yue>=5&&yue<=10){
                    zhekou = yuanjia*0.9;
                }else {
                    zhekou = yuanjia*0.85;
                }
                break;
            case "经济舱":
                if (yue>=5&&yue<=10){
                    zhekou = yuanjia*0.7;
                }else {
                    zhekou = yuanjia*0.65;
                }
                break;
        }
        System.out.println("折扣价为：" + zhekou);
    }
}
